<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>修改密码</title>
    <link rel="stylesheet" type="text/css" href="__CSS__/api.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__/aui.css"/>
    <style>
        body {
            background-color: #F4F4F4;
        }

        .outer {
            background-color: #FFFFFF;
            height: 64px;
            line-height: 64px;
            margin-top: 10.5px;
        }

        .inner {
            margin: 0 17.5px;
        }

        .avatar {
            width: 45.5px;
            height: 45.5px;
            border-radius: 50%;
            display: inline-block;
            vertical-align: middle;
        }

        .arrow {
            width: 22px;
            height: 64px;
            background: url(__IMG__/right_arrow.png) no-repeat right center;
            background-size: 7.5px 12.8px;
        }

        .outer1 {
            background-color: #FFFFFF;
            height: 45px;
            line-height: 45px;
            margin-top: 1px;
        }

        input[type="password"] {
            height: 43.9px;
            width: 100%;
            background-color: #fff;
            text-align: right;
            color: #545454;
            font-size: 14px;
            padding-right: 0;
        }

        input::-webkit-input-placeholder {
            color: #999;
            font-size: 14px;
        }

        .outer2 {
            background-color: #FFFFFF;
            height: 123px;
        }

        .title {
            color: #555555;
            font-size: 15px;

        }

    </style>
    <style>
        .aui-bar-nav .aui-iconfont {
            position: relative;
            z-index: 20;
            font-size: 14px;
            font-weight: 400;
            color: #FFFFFF;
            line-height: 44px;
        }

        .aui-icon-tu {
            height: 2.2rem;
            width: 44px;
            background: url(__IMG__/back.png) no-repeat center center;
            background-size: 44px 44px;
        }

        .create {
            font-size: 15px;
            color: #FFFFFF;
            width: 100%;
            height: 2.55rem;
            line-height: 2.55rem;
            text-align: center;
            background: -webkit-linear-gradient(right, #F04040, #FF7A7A);
            position: fixed;
            left: 0;
            bottom: 2.5rem;
        }
    </style>
</head>

<body>

<header class="aui-bar aui-bar-nav underLine">
    <a class="aui-pull-left" tapmode="active" onclick="history.go(-1);"> <span class="aui-iconfont aui-icon-tu"> </span>
    </a>
    <div class="aui-title">修改密码</div>
    <!--<a class="aui-pull-right" >
    <span class="aui-iconfont" tapmode="active" onclick="right()">保存</span>
    </a>-->
</header>
<form id="fabuorder">
    <div class="outer1">
        <div class="inner underLine flex-wrap">
            <div class="title">旧密码</div>
            <div class="flex-con">
                <input type="password" name="old" placeholder="输入旧密码"/>
            </div>
        </div>
    </div>
    <div class="outer1">
        <div class="inner underLine flex-wrap">
            <div class="title">新密码</div>
            <div class="flex-con">
                <input type="password" name="new" placeholder="输入新密码"/>
            </div>
        </div>
    </div>
    <div class="outer1">
        <div class="inner underLine flex-wrap">
            <div class="title">确认密码</div>
            <div class="flex-con">
                <input type="password" name="sure" placeholder="确认密码"/>
            </div>
        </div>
    </div>

    <input type="hidden" id="uid" name="user_id" value="{$userInitInfo.user_id}"/>
    <input type="hidden" name="user_pass" value="{$userInitInfo.user_password}"/>
    <div class="create" onclick="userinfoAjaxChange()">修改</div>
</form>
</body>
{include file="public/footer" /}
<script type="text/javascript">
    /**
     * ajax更改
     * */
    function userinfoAjaxChange() {
        $.ajax({
            url: '{:url("My/AjaxUpdatePass")}',
            data: $('#fabuorder').serialize(),//
            type: 'POST',
            dataType: 'JSON',
            success: function (data) {
                if (data.status == 200) {
                    layer.open({
                        content: '更改成功'
                        ,skin: 'msg'
                        ,time: 2 //2秒后自动关闭
                    });
                    window.history.back(-1);
                } else {
                    layer.open({
                        content: data.msg
                        ,skin: 'msg'
                        ,time: 2 //2秒后自动关闭
                    });
                    return false;
                }
            },
            error: function () {
                alert('Ajax error!');
            }
        })
    }
</script>

</html>
